Skip to content

Conversation

@layershifter
Copy link
Member

@layershifter layershifter commented Feb 28, 2023

New Behavior

Implements RFC #27009.

Now mountNode prop can be an object and allows to configure applied classes.

function App() {
  return (
    <>
      {/* There usages are equal */}
      <Tooltip mountNode={mountNode} />
      <Tooltip mountNode={{ element: mountNode }} />

      {/* Now applied classes can be configured 🔥 */}
      <Tooltip mountNode={{ className }} />
    </>
  );
}

Example with zIndex

import * as React from "react";
import {
  makeStyles,
  Popover,
  PopoverSurface,
  PopoverTrigger,
  tokens
} from "@fluentui/react-components";

const useClasses = makeStyles({
  mountNode: {
    color: tokens.colorBrandBackground,
    zIndex: 100
  }
});

function App() {
  const classes = useClasses();

  return (
    <Popover mountNode={{ className: classes.mountNode }}>
      <PopoverSurface>
        <div />
      </PopoverSurface>
    </Popover>
  );
}

Related Issue(s)

Fixes #26758

@size-auditor
Copy link

size-auditor bot commented Feb 28, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 533fcd3f705bc3161fb85f773fc396455f507d10 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Feb 28, 2023

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1341 1347 5000
Button mount 964 960 5000
Field mount 2054 2063 5000
FluentProvider mount 1697 1655 5000
FluentProviderWithTheme mount 634 630 10
FluentProviderWithTheme virtual-rerender 587 595 10
FluentProviderWithTheme virtual-rerender-with-unmount 624 634 10
InfoButton mount 592 567 5000
MakeStyles mount 1953 1895 50000
Persona mount 3073 3081 5000
SpinButton mount 2530 2548 5000

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 28, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 119e446:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

fabricteam commented Feb 28, 2023

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-combobox
Combobox (including child components)
88.622 kB
28.082 kB
88.7 kB
28.099 kB
78 B
17 B
react-combobox
ComboboxField
84.988 kB
27.82 kB
85.066 kB
27.838 kB
78 B
18 B
react-combobox
Dropdown (including child components)
87.309 kB
27.827 kB
87.387 kB
27.842 kB
78 B
15 B
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
206.206 kB
57.126 kB
206.273 kB
57.145 kB
67 B
19 B
react-infobutton
InfoButton
130.366 kB
39.382 kB
130.438 kB
39.407 kB
72 B
25 B
react-menu
Menu (including children components)
130.26 kB
39.493 kB
130.333 kB
39.499 kB
73 B
6 B
react-menu
Menu (including selectable components)
133.436 kB
40.038 kB
133.509 kB
40.037 kB
73 B
-1 B
react-popover
Popover
117.438 kB
35.784 kB
117.51 kB
35.799 kB
72 B
15 B
react-portal
Portal
11.377 kB
4.179 kB
11.715 kB
4.265 kB
338 B
86 B
react-tooltip
Tooltip
49.273 kB
16.775 kB
49.351 kB
16.799 kB
78 B
24 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-alert
Alert
90.467 kB
22.106 kB
react-avatar
Avatar
54.149 kB
14.571 kB
react-avatar
AvatarGroup
18.064 kB
6.664 kB
react-avatar
AvatarGroupItem
70.425 kB
19.075 kB
react-components
react-components: Button, FluentProvider & webLightTheme
67.03 kB
18.099 kB
react-components
react-components: FluentProvider & webLightTheme
37.861 kB
12.034 kB
react-dialog
Dialog (including children components)
92.72 kB
27.216 kB
react-persona
Persona
61.21 kB
16.521 kB
react-portal-compat
PortalCompatProvider
6.324 kB
2.129 kB
react-table
DataGrid
149.792 kB
40.502 kB
react-table
Table (Primitives only)
46.798 kB
12.557 kB
react-table
Table as DataGrid
137.684 kB
35.154 kB
react-table
Table (Selection only)
85.511 kB
21.173 kB
react-table
Table (Sort only)
84.832 kB
20.982 kB
🤖 This report was generated against 533fcd3f705bc3161fb85f773fc396455f507d10

@fabricteam
Copy link
Collaborator

fabricteam commented Feb 28, 2023

🕵 fluentuiv9 No visual regressions between this PR and main

@layershifter layershifter force-pushed the feat/mount-node-options branch from ccf6d78 to f72d5fb Compare February 28, 2023 17:12
@layershifter layershifter marked this pull request as ready for review March 3, 2023 09:09
@layershifter layershifter requested a review from a team as a code owner March 3, 2023 09:09
@layershifter layershifter force-pushed the feat/mount-node-options branch from 93c8e18 to 119e446 Compare March 14, 2023 10:34
@layershifter layershifter merged commit 6d89241 into microsoft:master Mar 14, 2023
@layershifter layershifter deleted the feat/mount-node-options branch March 14, 2023 15:09
GeoffCoxMSFT pushed a commit to GeoffCoxMSFT/fluentui that referenced this pull request Mar 14, 2023
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Mar 15, 2023
* master: (141 commits)
  chore: prerequisite changes before migrating v9 packages to SWC based transpilation (microsoft#26965)
  feat: Add InfoLabel component (microsoft#27118)
  fix(tools): update migrate-converged generator to add node field to package.json exports map (microsoft#27152)
  applying package updates
  fix: Embed play/pause indicator should render correctly in high contrast mode (microsoft#27213)
  feat(tokens): Add colorNeutralBackgroundAlpha and colorNeutralStrokeAlpha tokens (microsoft#27034)
  chore: Prepare release 0.66.4 (microsoft#27163)
  fix(react-datepicker-compat): Fix text entry issues with input (microsoft#27204)
  fix: Smooth out animation of indeterminate progress bar (microsoft#27201)
  Add cxe-red as a codeowner of react-file-type-icons (microsoft#27147)
  Added documentation about custom style hooks (microsoft#27087)
  Custom style react-text (microsoft#27078)
  Custom style react-image (microsoft#27066)
  Add JSDoc for tabster focus indicator selector (microsoft#27041)
  Theme designer: Move colors to local files (microsoft#27191)
  docs(react-card): move card out of preview (microsoft#27185)
  Include values in typography table (microsoft#27189)
  feat: accept a className in `mountNode` in `Portal` (microsoft#27008)
  RFC: Extend `mountNode` prop in `Portal` (microsoft#27009)
  applying package updates
  ...
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Mar 15, 2023
* master: (141 commits)
  chore: prerequisite changes before migrating v9 packages to SWC based transpilation (microsoft#26965)
  feat: Add InfoLabel component (microsoft#27118)
  fix(tools): update migrate-converged generator to add node field to package.json exports map (microsoft#27152)
  applying package updates
  fix: Embed play/pause indicator should render correctly in high contrast mode (microsoft#27213)
  feat(tokens): Add colorNeutralBackgroundAlpha and colorNeutralStrokeAlpha tokens (microsoft#27034)
  chore: Prepare release 0.66.4 (microsoft#27163)
  fix(react-datepicker-compat): Fix text entry issues with input (microsoft#27204)
  fix: Smooth out animation of indeterminate progress bar (microsoft#27201)
  Add cxe-red as a codeowner of react-file-type-icons (microsoft#27147)
  Added documentation about custom style hooks (microsoft#27087)
  Custom style react-text (microsoft#27078)
  Custom style react-image (microsoft#27066)
  Add JSDoc for tabster focus indicator selector (microsoft#27041)
  Theme designer: Move colors to local files (microsoft#27191)
  docs(react-card): move card out of preview (microsoft#27185)
  Include values in typography table (microsoft#27189)
  feat: accept a className in `mountNode` in `Portal` (microsoft#27008)
  RFC: Extend `mountNode` prop in `Portal` (microsoft#27009)
  applying package updates
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: allow to change popover's z-index when it's rendered out of DOM

4 participants